Many database structures rely upon Structured Query Language (SQL) as the standard approach to define, read, and manipulate data within a database. The database can include constraints and triggers used to specify rules for data in a database table. A constraint defines properties that data stored in a database must comply with. The constraint can be applied to a column, table, multiple tables, or an entire database schema.
A database trigger is code that is automatically executed in response to an event for the purpose of maintaining the integrity of data on the database. For example, when a new record is added to an employees' table, a new record should also be added in the salaries table for the new employee. The constraints and triggers belong to a Data Manipulation Language (DML) and are used to add data level validation checks (i.e., checks are added to concrete database tables) that are executed when data is modified on a database table. Modification can include executing insert, update, and delete statements.
Violation of a constraint results in reverting the change in the database and writing out a corresponding error message. By definition these constraints and triggers are only applied when data changes in the database table. Thus, there is a need for techniques for expanding the use of constraints and triggers beyond when data is modified within a database table.